//
//  YWAttendanceDBManager.h
//  maintain
//
//  Created by kyo on 16/11/8.
//  Copyright © 2016年 ewin. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "YWSingleton.h"

@class YWAttendanceRecord;

@interface YWAttendanceDBManager : NSObject
YWSingletonH(Manager)
/**
 *  创建签到表
 *
 *  @return 结果
 */
- (BOOL)createAttendanceRecordTable;
- (BOOL)addColumInAttendanceRecord;
#pragma mark - attendance_record table
/**
 *  获取最新一条记录
 *
 *  @return 记录对象
 */
- (YWAttendanceRecord*)newestAttendanceRecord;
/**
 *  更新记录内容
 *
 *  @param record 签到记录对象
 *
 *  @return 执行结果
 */
- (BOOL)updateAttendanceRecordWithRecord:(YWAttendanceRecord*)record;
/**
 *  获取所有的签到记录
 *
 *  @return 记录对象数组
 */
- (NSArray*)attendanceRecordWithPage:(NSInteger)page;
/**
 *  修改签到记录的状态
 *
 *  params recordId
 */
- (BOOL)updateAttendanceUploadStatus:(NSInteger)uploadStatus withAttendanceRecordId:(NSString*)recordId;
/**
 *  修改签到记录的状态
 *
 *  params recordId
 */
- (BOOL)updateAttendance:(YWAttendanceRecord*)attendance withRecordId:(NSString*)recordId;
/**
 *  获取上传失败的签到记录
 *
 *  @return 签到模型数组
 */
- (NSArray*)attendanceRecordWithUploadStatusFail;
/**
 *  更新签到表，数组更新
 *
 *  @param attendanceRecordArray 数组
 *
 *  @return 结果
 */
- (BOOL)updateAttendanceRecordWithAttendRecordArray:(NSArray*)attendanceRecordArray;
@end
